package im.xz.cn.xiacore.commands.gemini;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public class gmsp implements CommandExecutor {
    @Override
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
        Player player = (Player) commandSender;
        try {
            if (player.hasPermission("xzrui.command.gmsp")) {
                player.setGameMode(GameMode.SPECTATOR);
            }else {
                player.sendMessage(ChatColor.RED + "你没有权限！");
            }
        }catch (NullPointerException ignore) {

        }
        return false;
    }
}